package com.wing.product.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 产品包装条码数量变化记录
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("pro_product_pack_label_out")
public class ProductPackLabelOut extends BaseEntity<ProductPackLabelOut> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum Status implements IEnum<Integer> {

        /**
        * 签收
        */
        sign(0,"签收"),
        /**
        * 未签收
        */
        unreceipted(1,"未签收");

        private int code;
        private String desc;

        Status(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 条码数值
     */
    private Integer quantityCurrent;

    /**
     * 条码id
     */
    private Long packLabelId;

    /**
     * 变动后数量
     */
    private Integer quantityAfter;

    /**
     * 取出数量
     */
    private Integer quantityOut;

    /**
     * 是否签收
     */
    private Status status;

    /**
    * 是否签收描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status == null ? null : status.getDesc();
    }

}
